<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content=
    "application/xhtml+xml; charset=iso-8859-1" />
    <title>
      pm-utils-1.4.1
    </title>
    <link rel="stylesheet" type="text/css" href="../stylesheets/lfs.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.79.1" />
    <link rel="stylesheet" href="../stylesheets/lfs-print.css" type=
    "text/css" media="print" />
  </head>
  <body class="blfs" id="blfs-9.1">
    <div class="navheader">
      <h4>
        Beyond Linux<sup>�</sup> From Scratch <span class="phrase">(System
        V</span> Edition) - Version 9.1
      </h4>
      <h3>
        Chapter&nbsp;12.&nbsp;System Utilities
      </h3>
      <ul>
        <li class="prev">
          <a accesskey="p" href="pciutils.html" title=
          "pciutils-3.6.4">Prev</a>
          <p>
            pciutils-3.6.4
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="raptor.html" title="Raptor-2.0.15">Next</a>
          <p>
            Raptor-2.0.15
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="sysutils.html" title=
          "Chapter&nbsp;12.&nbsp;System Utilities">Up</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Beyond Linux� From Scratch     (System V Edition) - Version 9.1">Home</a>
        </li>
      </ul>
    </div>
    <div class="sect1" lang="en" xml:lang="en">
      <h1 class="sect1">
        <a id="pm-utils" name="pm-utils"></a>pm-utils-1.4.1
      </h1>
      <div class="package" lang="en" xml:lang="en">
        <h2 class="sect2">
          Introduction to Power Management Utilities
        </h2>
        <p>
          The <span class="application">Power Management Utilities</span>
          provide simple shell command line tools to suspend and hibernate
          the computer. They can be used to run user supplied scripts on
          suspend and resume.
        </p>
        <p>
          This package is known to build and work properly using an LFS-9.1
          platform.
        </p>
        <h3>
          Package Information
        </h3>
        <div class="itemizedlist">
          <ul class="compact">
            <li class="listitem">
              <p>
                Download (HTTP): <a class="ulink" href=
                "https://pm-utils.freedesktop.org/releases/pm-utils-1.4.1.tar.gz">
                https://pm-utils.freedesktop.org/releases/pm-utils-1.4.1.tar.gz</a>
              </p>
            </li>
            <li class="listitem">
              <p>
                Download MD5 sum: 1742a556089c36c3a89eb1b957da5a60
              </p>
            </li>
            <li class="listitem">
              <p>
                Download size: 204 KB
              </p>
            </li>
            <li class="listitem">
              <p>
                Estimated disk space required: 1.6 MB
              </p>
            </li>
            <li class="listitem">
              <p>
                Estimated build time: 0.1 SBU
              </p>
            </li>
          </ul>
        </div>
        <h3>
          Power Management Utilities Dependencies
        </h3>
        <h4>
          Optional
        </h4>
        <p class="optional">
          <a class="xref" href="../pst/xmlto.html" title=
          "xmlto-0.0.28">xmlto-0.0.28</a> (to generate man pages)
        </p>
        <h4>
          Optional (runtime)
        </h4>
        <p class="optional">
          <a class="xref" href="hdparm.html" title=
          "Hdparm-9.58">Hdparm-9.58</a>, <a class="xref" href=
          "../basicnet/wireless_tools.html" title=
          "Wireless Tools-29">Wireless Tools-29</a>, <a class="ulink" href=
          "https://www.kernel.org/pub/software/network/ethtool/">ethtool</a>,
          and <a class="ulink" href=
          "http://ftp.de.debian.org/debian/pool/main/v/vbetool/">vbetool</a>
        </p>
        <p class="usernotes">
          User Notes: <a class="ulink" href=
          "http://wiki.linuxfromscratch.org/blfs/wiki/pm-utils">http://wiki.linuxfromscratch.org/blfs/wiki/pm-utils</a>
        </p>
      </div>
      <div class="kernel" lang="en" xml:lang="en">
        <h2 class="sect2">
          <a id="pm-utils-kernel" name="pm-utils-kernel"></a>Kernel
          Configuration
        </h2>
        <p>
          If needed, enable the following options in the kernel configuration
          and recompile the kernel:
        </p>
        <pre class="screen">
<code class="literal">Power management and ACPI options ---&gt;
    &lt;*&gt; Suspend to RAM and standby            [CONFIG_SUSPEND]
    &lt;*&gt; Hibernation (aka 'suspend to disk')   [CONFIG_HIBERNATION]</code>
</pre>
        <p>
          Suspend to RAM allows the system to enter sleep states in which
          main memory is powered and thus its contents are preserved. The
          method cuts power to most parts of the machine aside from the RAM.
          Because of the large power savings, it is advisable for laptops to
          automatically enter this mode when the computer is running on
          batteries and the lid is closed (or the user is inactive for some
          time).
        </p>
        <p>
          Suspend to disk (Hibernation) saves the machine's state into swap
          space and completely powers off the machine. When the machine is
          powered on, the state is restored. Until then, there is zero power
          consumption. Suspend to RAM and hibernation are normally
          appropriate for portable devices such as laptops, but can be used
          on workstations. The capability is not really appropriate for
          servers.
        </p>
        <p>
          To use hibernation, the kernel parameter
          resume=/dev/&lt;swap_partition&gt; has to be used on the kernel
          command line (in grub.cfg). The swap partition should be at least
          the size of the physical RAM on the system.
        </p>
      </div>
      <div class="installation" lang="en" xml:lang="en">
        <h2 class="sect2">
          Installation of Power Management Utilities
        </h2>
        <p>
          Install <span class="application">Power Management Utilities</span>
          by running the following commands:
        </p>
        <pre class="userinput">
<kbd class="command">./configure --prefix=/usr     \
            --sysconfdir=/etc \
            --docdir=/usr/share/doc/pm-utils-1.4.1 &amp;&amp;
make</kbd>
</pre>
        <p>
          This package does not come with a test suite.
        </p>
        <p>
          Now, as the <code class="systemitem">root</code> user:
        </p>
        <pre class="root">
<kbd class="command">make install</kbd>
</pre>
        <p>
          If you don't have <a class="xref" href="../pst/xmlto.html" title=
          "xmlto-0.0.28">xmlto-0.0.28</a> installed, copy pregenerated man
          pages, as the <code class="systemitem">root</code> user:
        </p>
        <pre class="root">
<kbd class="command">install -v -m644 man/*.1 /usr/share/man/man1 &amp;&amp;
install -v -m644 man/*.8 /usr/share/man/man8 &amp;&amp;
ln -sv pm-action.8 /usr/share/man/man8/pm-suspend.8 &amp;&amp;
ln -sv pm-action.8 /usr/share/man/man8/pm-hibernate.8 &amp;&amp;
ln -sv pm-action.8 /usr/share/man/man8/pm-suspend-hybrid.8</kbd>
</pre>
      </div>
      <div class="configuration" lang="en" xml:lang="en">
        <h2 class="sect2">
          Configuring Power Management Utilities
        </h2>
        <p>
          Suspend or resume functionality can be easily modified by
          installing files into the <code class=
          "filename">/etc/pm/sleep.d</code> directory. These files, known as
          hooks, are run when the system is put into a sleep state or
          resumed. Default hooks are located in <code class=
          "filename">/usr/lib/pm-utils/sleep.d</code>, and user hooks should
          be put in <code class="filename">/etc/pm/sleep.d</code>. See the
          pm-action(8) man page for more information.
        </p>
        <p>
          In order to use hibernation with <span class=
          "application">GRUB</span> and a swap partition, you need to add
          kernel parameter <code class="literal">resume=<em class=
          "replaceable"><code>swap_partition</code></em></code> (e.g.
          <code class="literal">resume=/dev/sda1</code>) to the kernel line
          in the <code class="filename">/boot/grub/grub.cfg</code>
          configuration file.
        </p>
      </div>
      <div class="content" lang="en" xml:lang="en">
        <h2 class="sect2">
          Contents
        </h2>
        <div class="segmentedlist">
          <div class="seglistitem">
            <div class="seg">
              <strong class="segtitle">Installed Programs:</strong>
              <span class="segbody">on_ac_power, pm-hibernate,
              pm-is-supported, pm-powersave, pm-suspend and
              pm-suspend-hybrid</span>
            </div>
            <div class="seg">
              <strong class="segtitle">Installed Libraries:</strong>
              <span class="segbody">None</span>
            </div>
            <div class="seg">
              <strong class="segtitle">Installed Directories:</strong>
              <span class="segbody">/etc/pm, /usr/lib/pm-utils and
              /usr/share/doc/pm-utils-1.4.1</span>
            </div>
          </div>
        </div>
        <div class="variablelist">
          <h3>
            Short Descriptions
          </h3>
          <table border="0" class="variablelist">
            <colgroup>
              <col align="left" valign="top" />
              <col />
            </colgroup>
            <tbody>
              <tr>
                <td>
                  <p>
                    <a id="on_ac_power" name="on_ac_power"></a><span class=
                    "term"><span class=
                    "command"><strong>on_ac_power</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is a script that determines whether the system is running
                    on AC power (rather than a battery).
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="pm-hibernate" name="pm-hibernate"></a><span class=
                    "term"><span class=
                    "command"><strong>pm-hibernate</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is a symlink to pm-action script that puts the computer
                    into hibernate mode (the system is fully powered off and
                    system state is saved to disk).
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="pm-is-supported" name=
                    "pm-is-supported"></a><span class="term"><span class=
                    "command"><strong>pm-is-supported</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is a script that checks whether power management features
                    such as suspend and hibernate are supported.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="pm-powersave" name="pm-powersave"></a><span class=
                    "term"><span class=
                    "command"><strong>pm-powersave</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is a script that puts the computer into powersaving (low
                    power) mode.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="pm-suspend" name="pm-suspend"></a><span class=
                    "term"><span class=
                    "command"><strong>pm-suspend</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is a symlink to pm-action script that puts the computer
                    into suspend mode (most devices are shut down and system
                    state is saved in RAM).
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="pm-suspend-hybrid" name=
                    "pm-suspend-hybrid"></a><span class="term"><span class=
                    "command"><strong>pm-suspend-hybrid</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is a symlink to pm-action script that puts the computer
                    into hybrid-suspend mode (the system does everything it
                    needs to hibernate, but suspends instead of shutting
                    down).
                  </p>
                </td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
      <p class="updated">
        Last updated on 2020-02-16 15:50:16 -0800
      </p>
    </div>
    <div class="navfooter">
      <ul>
        <li class="prev">
          <a accesskey="p" href="pciutils.html" title=
          "pciutils-3.6.4">Prev</a>
          <p>
            pciutils-3.6.4
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="raptor.html" title="Raptor-2.0.15">Next</a>
          <p>
            Raptor-2.0.15
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="sysutils.html" title=
          "Chapter&nbsp;12.&nbsp;System Utilities">Up</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Beyond Linux� From Scratch     (System V Edition) - Version 9.1">Home</a>
        </li>
      </ul>
    </div>
  </body>
</html>
